package annotation;

import com.alibaba.druid.pool.DruidDataSource;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

import javax.sql.DataSource;
@Component
public class OtherBean {
    @Bean("dataSource")
    public DataSource dataSource(@Value("${jdbc.driver}") String driverClassName){
        DruidDataSource dataSource=new DruidDataSource();
        System.out.println(driverClassName);
        return dataSource;
    }
}
